#ifndef DATESCALEDRAW_H
#define DATESCALEDRAW_H

#include "qwt_scale_draw.h"
#include <QDateTime>


class DateScaleDraw: public QwtScaleDraw
{
public:
    DateScaleDraw();

    virtual QwtText label(double v) const
    {
        //from
        //http://stackoverflow.com/questions/2935041/how-to-convert-from-timestamp-to-data-in-qt
        int unixTime = (int) v;
        QDateTime timestamp;
        timestamp.setTime_t(unixTime);
//        return timestamp.toString(Qt::SystemLocaleShortDate);
//        return timestamp.toString("d/M/yy");
        return timestamp.toString(" ");
    }
};

#endif // DATESCALEDRAW_H
